<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ include file="/WEB-INF/views/include/constrant.jsp"%>
<jsp:include page="/WEB-INF/views/layouts/head.jsp"></jsp:include>
<html>
<head>
<title>按天包车</title>
<link href="${ctxStatic}/jquery-select2/3.4/fselect2.min.css" rel="stylesheet" />
<link rel="stylesheet" href="${ctxStatic }/index/css/daycars2.css" />
<link href="${ctxStatic }/xiake/css/list.css" rel='stylesheet' type='text/css' />
<link href="${ctxStatic }/cityselector/cityselect.css" rel='stylesheet'type='text/css' />
<script type="text/javascript" src="${ctxStatic }/index/js/xiake.js"></script>
<script type="text/javascript">
	$(function() {
		// 初始化站点选择框
		$.post('${ctxFront}/info/site/siteJson',{spottypes:'0,b'}, function(data) {
			var allCity = data;//['北京市#001#1|beijing|bj','上海市#002#0|shanghai|sh'];
			new Vcity.CitySelector({input:'departcity_sitename',cityData:allCity});
		});
		$('.tstyle').click(function(){
			$("#tsy").val($(this).attr("value"));
			$("#pageNo").val(1);
			$("#pageSize").val(6);
			$('#searchForm').submit();
		});
		$('#daysearch').click(function(){
			$("#pageNo").val(1);
			$("#pageSize").val(6);
			$('#searchForm').submit();
		});
		//日租包车
		$('.dayRentType').on('change',function(){
			changeRentType($(this).val());
		});
		var keyVal2 = "${sessionScope.mes}";
		if(keyVal2.length!=0){  
			alert(keyVal2);
			/* window.location.href = '${ctxFront }/indexDayRent'; */
		}
		changeRentType($('.dayRentType:checked').val());
	})
	function changeRentType(val){
	if(val=='市内') {
		$('#destcity_sitename').attr('disabled','disabled');
		$('#destcity_sitename').parent().hide();
		$('#half').removeAttr("disabled");
	}
	if(val=='跨市') {
		$('#destcity_sitename').removeAttr('disabled');
		$('#destcity_sitename').parent().hide();
		$('#half').attr('disabled',"true");
	}
}
	function page(n,s){
		$("#pageNo").val(n);
		$("#pageSize").val(s);
		$("#searchForm").submit();
		return false;
	}
</script>
</head>
<%
session.removeAttribute("mes");
	%>
<body><input type="hidden" id="menuInfo" value="indexDayRent">
    <div class="day-car">
			<div class="day-warp">
				<div class="day-cantion clearfix">
			<form id="searchForm" action="${ctxFront }/rentproduct/list" method="get">
			<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
			<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
			<input type="hidden" name="rentType" value="${ORDER_TYPE_RENTPRODUCT_DAY }"/>
			<input type="hidden" name="tstyle" value="${tstyle }" id="tsy"/>
					 <div class="top_tab">
						<div class="c-city kl_cv">
						</div> 
						 <div class="n-city kl_cv " >
					</div> 
					</div>
					<div class="requrie_box">
						<div class="day-list1">
							<ul class="d-l-box">
								<li class="outcity">
									<label>出发城市：</label>
				<input type="text" id="departcity_sitename" class="container_type_a" name="departcity.sitename" value="${tRentproduct.departcity.sitename }" placeholder="请输入服务开始城市" autocomplete="off">
				<input type="hidden" name="departcity.siteid" value="${tRentproduct.departcity.siteid }">
								</li>
								<li class="out-dt">
									<div class="out-date">
										<label>出发时间：</label>
				<input id="fromdateStr" name="fromdateStr" type="text" readonly="readonly" maxlength="20" class="container_type_sn Wdate"
					value="${tRentproduct.fromdateStr }"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'${currDateYmdStr}',maxDate:'${maxDay }',isShowClear:false});"/>&nbsp;
				<input id="time" name="time" type="text" readonly="readonly" maxlength="20" class="container_type_ss Wdate" value="${tRentproduct.time }"
					onclick="WdatePicker({dateFmt:'HH:mm',isShowClear:false});"/>
									</div>
								</li>
				<div class="flex_con_line hide" id="day_destcity_code_div">
				<label class="display_ib">目的地</label>
				<input type="text" id="destcity_sitename" class="container_type_a" name="destcity.sitename" value="${tRentproduct.destcity.sitename }" placeholder="请输入服务结束城市" autocomplete="off">
				<input type="hidden" name="destcity.siteid" value="${tRentproduct.destcity.siteid }">>
				</div>				
								<li >
									<label>包车天数：</label>
				<select id="daysnum" name="daysnum" class="container_type_d" style="border: 1px solid #CDCDCD;">
				     <option value="0" ${tRentproduct.daysnum == 0?'selected':'' } id="half"
				      class="half_day">0.5天</option>
					         <c:forEach items="1,2,3,4,5,6,7,8,9,10" var="day">
					         <option value="${day }" ${tRentproduct.daysnum == day?'selected':'' }>${day }天</option>
					         </c:forEach>
				</select>
								</li>
				<li class="x_dq_box">
				<label>包车范围：</label>
				<label class="city_ks">
				<input type="radio" name="tabType" id="ks" class="x_dp_i dayRentType" value="跨市" ${tRentproduct.tabType == '跨市'?'checked':'' }/>
				<span>跨市包车</span>
				</label>
				<label class="city_sn">
				<input type="radio"  class="x_dp_i dayRentType" name="tabType" value="市内" ${tRentproduct.tabType == '市内'?'checked':'' }/>
				<span>市内包车</span>
				</label>
				</li>
				</ul>
				<div  style="margin-top: -11px;">
					<button id="daysearch" class="days-query">查询</button>
				</div>
				</div>	
				</div></form>
					</div> 
					<div class="cars-box">
		<p style="padding-bottom: 10px;border-bottom: 1px dashed #cdcdcd;">选择车型：</p>
		<ul class="car-list">
				<li class="car-il car-title">
					<a  class="tstyle" value="" href="javascript:;">
						<i class="iconfont" style="color: #00b388;font-size:38px; line-height: 50px;">&#xe61d;</i>
						<span class="m-txt car-tgreen" >不限</span>
					</a>
							</li>
			
							<li class="car-il">
								<a  class="tstyle" value="xc"  href="javascript:;">
									<i class="iconfont ico_c"<c:if test="${tstyle=='xc' }">style="color: #00b388;font-size: 50px;line-height: 50px;"</c:if>>&#xe66c;</i>
									<span class="m-txt <c:if test="${tstyle=='xc' }">car-tgreen</c:if>">4座小车</span>
								</a>
							</li>
							<li class="car-il">
								<a  class="tstyle" value="swc">
									<i class="iconfont ico_c" <c:if test="${tstyle=='swc' }">style="color: #00b388;font-size: 50px;line-height: 50px;"</c:if>>&#xe607;</i>
									<span class="m-txt <c:if test="${tstyle=='swc' }">car-tgreen</c:if>">6座商务车</span>
								</a>
							</li>
							<li class="car-il">
								<a  class="tstyle" value="xb">
								   <i class="iconfont ico_c" <c:if test="${tstyle=='xb' }">style="color: #00b388;font-size: 50px;line-height: 50px;"</c:if>>&#xe61b;</i>
									<span class="m-txt <c:if test="${tstyle=='xb' }">car-tgreen</c:if>">14座以下小巴</span>
								</a>
							</li>
							<li class="car-il">
								<a  class="tstyle" value="zb">
									<i class="iconfont ico_c" <c:if test="${tstyle=='zb' }">style="color: #00b388;font-size: 50px;line-height: 50px;"</c:if>>&#xe65d;</i>
									<span class="m-txt <c:if test="${tstyle=='zb' }">car-tgreen</c:if>">24座以下中巴</span>
								</a>
							</li>
							<li class="car-il">
								<a  class="tstyle" value="db">
									<i class="iconfont ico_c" <c:if test="${tstyle=='db' }">style="color: #00b388;font-size: 50px;line-height: 50px;"</c:if>>&#xe65d;</i>
									<span class="m-txt <c:if test="${tstyle=='db' }">car-tgreen</c:if>" >25座以上大巴</span>
								</a>
							</li>
						</ul>	
					</div>
				</div>
		</form>	
			<div class="daycar-main">
					<script>
		$(function(){
			    var hif=true;
			$('.caro_jia').click(function(){
				if(hif){
				$(this).css('background','url(${ctxStatic }/index/images/jian.png)');
								$(this).siblings('.hid_price').slideDown();
				hif=false;
				}else{
				$(this).css('background','url(${ctxStatic }/index/images/jia.png)');
				      $(this).siblings('.hid_price').slideUp();
				hif=true;
				}
			})
		     	hif!=hif;

		})
	</script>
<div class="carday_vs">
<c:if test="${not empty cargotypeList and not empty rentproductList}">
<c:forEach items="${cargotypeList }" var="cargotype">
               <div class="carf_list">
               	    <div class="carf_oi">
               	    	 <div class="carg_i">
               	    	 	 <div class="carg_l_img">
               	    	 	 	  <img src="${cargotype.images }" />
               	    	 	 </div>
               	    	 	 <div class="carg_r_ex">
               	    	 	 	   <div class="carg_nm">
               	    	 	 	   	   <p>
               	    	 	 	   	   	   <span>${cargotype.typename }</span>
               	    	 	 	   	   	   <span>
               	    	 	 	   	   	   	    <i class="cig-ico01"></i>
               	    	 	 	   	   	   	    <b>载客${cargotype.seats }人</b>
               	    	 	 	   	   	   </span>
               	    	 	 	   	   	   <span>
               	    	 	 	   	   	   	    <i class="cig-ico02"></i>
               	    	 	 	   	   	   	    <b>行李${cargotype.packs }件</b>
               	    	 	 	   	   	   </span>
               	    	 	 	   	   </p>
               	    	 	 	   	   <p>${cargotype.typedesc }</p>
               	    	 	 	   </div>
               	    	 	 </div>
               	    	 	 <div class="carg_kl">
               	    	 	 	   	    <p>
               	    	 	 	   	 <c:if test="${tRentproduct.daysnum==0 }">
									￥<fmt:formatNumber type="text" value="${cargotype.rentproductList[0].suitrtnprice*0.8 }" pattern="0" maxFractionDigits="0"/>${local_type==1?'／天':'' }
									</c:if><c:if test="${tRentproduct.daysnum!=0}">
										￥<fmt:formatNumber type="number" value="${cargotype.rentproductList[0].suitrtnprice }" pattern="0" maxFractionDigits="0"/>${local_type==1?'／天':'' }
										</c:if>   起</p>
               	    	 	 	   	    <p>共报价&nbsp;<b>${fn:length(cargotype.rentproductList)}</b>&nbsp;个</p>
               	    	 	 </div>
               	    	 </div>
               	    	 <div class="caro_li">
               	    	 	 <div class="caro_ik_tit">
               	    	 	 	  <span>车队</span>
               	    	 	 	  <span>特色服务</span>
               	    	 	 	  <span>价格/天</span>
               	    	 	 	  <span>操作</span>
               	    	 	 </div>
               	    	 	 <div class="caro_body">
               	    	 	 	<c:if test="${fn:length(cargotype.rentproductList)!=1}"><i class="caro_jia"></i></c:if>
               	    	 	 	<c:forEach items="${cargotype.rentproductList }" var="rentproduct" varStatus="vs">
               	    	 	 	 <div class="caro_ik <c:if test='${vs.index==0 }'>m_price</c:if> <c:if test='${vs.index!=0 }'>hid_price</c:if> ">
               	    	 	 	 	 <span>${rentproduct.office.abbr }  </span>
               	    	 	 	 	 <span><c:if test="${rentproduct.office.iswifi == '1' }">无线wifi</c:if>
							<c:if test="${rentproduct.office.powersupply == '1' }">车载充电</c:if>
							<c:if test="${rentproduct.office.tablewater == '1' }">免费饮用水</c:if>
							<c:if test="${rentproduct.office.businesssuit == '1' }">商务正装</c:if>
							<c:if test="${rentproduct.office.paper == '1' }">免费纸巾</c:if></span>
               	    	 	 	 	 <span>
               	    	 	 <c:if test="${tRentproduct.daysnum==0 }">
							<fmt:formatNumber type="text" value="${rentproduct.suitrtnprice*0.8 }" pattern="0" maxFractionDigits="0"/>${local_type==1?'／天':'' }
							</c:if><c:if test="${tRentproduct.daysnum!=0 }">
							<fmt:formatNumber type="number" value="${rentproduct.suitrtnprice }" pattern="0" maxFractionDigits="0"/>${local_type==1?'／天':'' }
							</c:if> 元</span>
               	    	 	 	 	 <span>
               	    	<a class="dc-button" id="detail" href="javascript:window.location.href=
								'${ctxFront}/sms/details?time='+$('#time').val()+'
								&daysnum=${tRentproduct.daysnum }&images=${cargotype.images }&rentid=${rentproduct.rentid}&office.iswifi=${rentproduct.office.iswifi }
								&office.powersupply=${rentproduct.office.powersupply }&office.tablewater=${rentproduct.office.tablewater }
								&office.businesssuit=${rentproduct.office.businesssuit }&office.paper=${rentproduct.office.paper }
								&rentType=${tRentproduct.rentType}&tabType=${tRentproduct.tabType}&fromdateStr='
								+$('#fromdateStr').val();" >预定</a>
               	    	 	 	 	 </span>
               	    	 	 	 </div>
               	    	 	 </c:forEach> 	 
               	    	 	 </div>
               	    	 </div>
               	    </div>
               </div>
 </c:forEach>
   </c:if>              
		</div>
		</div>
		</div>
		<c:if test="${empty cargotypeList or  empty rentproductList }">
			<div style="text-align: center;margin:20px;font-size:14px;color:#607D8B;">霞客君太懒，您要的产品还没有上架。您可以试试<a href="${ctxFront }/rentproduct/demands/form" style="color:#4FBDBA;">定制包车</a>哦~</div>
		</c:if>
		<c:if test="${not empty cargotypeList and not empty rentproductList }">
		<div style="text-align: center;">
		<div class="pagination  font_normal_size" >${page.html}</div></div></c:if>
</body>
</html>
	<jsp:include page="/WEB-INF/views/layouts/foot.jsp"></jsp:include>